package  
{
	/**
   * ...
   * @author ivan
   */
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.geom.Point;
  import mge.graph.Node;

  public class VisualNode extends Sprite
  {
    public function VisualNode(node:Node)
    {
      this.node = node;
      addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
    }
    
    private function onAddedToStage(e:Event):void
    {
      removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
      
      addEventListener(Event.ENTER_FRAME, draw);
      
      this.mouseEnabled = true;
      this.buttonMode = true;
    }
        
    private function draw(e:Event):void
    {
      x = node.x;
      y = node.y;
      
      graphics.clear();      
      graphics.beginFill(0xDD3333);
      graphics.drawCircle(0, 0, nodeSize);      
      graphics.endFill();
    }
    
    public var node:mge.graph.Node;
    public static var nodeSize:Number = 3;
    
  }

}